<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form name="f1">
      <p><input name="allow" type="checkbox" /> 同意...</p>
      <button name="saveBtn" type="button">提交</button>
    </form>
    <script>
      document.f1.saveBtn.onclick = function () {
        console.log(document.f1.allow.checked);
      };
      setTimeout(() => {
        document.f1.allow.checked = true;
      }, 3000);
    </script>
  </body>
</html>
